<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="采购记录" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script language="javascript">
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	function doGo(pageIndex){
		window.location="/purchase/PurchaseBillItemListForEstablishment.ihtm?id=${id}&current_page="+pageIndex;
	}
</script>
</head>
<body oncontextmenu="return false" class="sheet" style="text-align:center;">
<div class="sheet-main" style="width:860px;text-align:left;margin:auto;">
	<div class="sheet-top">
		<div class="content">
		  <h2>采购记录</h2>
		  <p>供应商名称：${est.estName}</p>
		</div>
	</div>
	  <div class="sheet-list">
		  <div class="cue-info">
			<span>金额汇总：${costTotal}元</span>
	      </div>
			  <div class="table-list">
			     <table width="100%" align="center">      
	 					<tr>	
							<th width="14%">日期</th>
							<th width="14%">材料编号</th>
							<th width="20%">品名规格</th>
							<th width="10%">单位</th>
							<th width="10%">数量</th>
							<th width="10%">单价</th>
							<th width="14%">金额</th>
							<th width="8%" >类型</th>
						</tr>
						<c:forEach var="item" items="${qr.list}">
						<c:set var="color" value="black" />
						<c:if test="${item[7]=='BACK'}"><c:set var="color" value="red" /></c:if>
						<tr style="color:${color}">
							<td><fmt:formatDate value="${item[0]}" pattern="yyyy-MM-dd"/></td>
							<td>${item[1]}</td>
							<td>${item[2]}</td>
							<td>${item[3]}</td>
							<td><commonTag:parseBigDecimal source="${item[4]}" /></td>
							<td><commonTag:parseBigDecimal source="${item[5]}" /></td>
							<td><commonTag:parseBigDecimal source="${item[6]}" /></td>
							<td>
								<c:if test="${item[7]=='BUY'}">采购</c:if>
								<c:if test="${item[7]=='BACK'}">退货</c:if>
							</td>
						</tr>
						</c:forEach>
				   </table>
				   <%@include file="../inc/Pages.jsp"%>
			  </div>
			</div>
</div>
</body>
</html>